package org.hcf.data.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.hcf.data.entity.ChatUserNotReceive;
import org.hcf.data.mapper.ChatUserNotReceiveMapper;
import org.hcf.data.service.IChatUserNotReceiveService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xianiyitiao
 * @since 2024-04-25
 */
@Service
public class ChatUserNotReceiveServiceImpl extends ServiceImpl<ChatUserNotReceiveMapper, ChatUserNotReceive> implements IChatUserNotReceiveService {

    @Override
    public ChatUserNotReceive getMessages(long userId, int msgCode) {
        return getOne(new LambdaQueryWrapper<ChatUserNotReceive>().eq(ChatUserNotReceive::getUserId, userId).eq(ChatUserNotReceive::getMsgCode, msgCode));
    }

    @Override
    public List<ChatUserNotReceive> getMessages(long userId) {
        return list(new LambdaQueryWrapper<ChatUserNotReceive>().eq(ChatUserNotReceive::getUserId, userId));
    }
}
